Prevent premature device free in interface_claim_device
authorFelix Fietkau <[email protected]>
Thu, 11 Aug 2016 17:36:09 +0000 (19:36 +0200)
committerFelix Fietkau <[email protected]>
Thu, 11 Aug 2016 17:36:12 +0000 (19:36 +0200)
commitc8a5f1ae361ab61192be6085c29d977eb73a05f5
tree65918e9f440b766a29b4d68e80bf8c4dc59691fb
parentcec1ce296eede81dc62628fce33b8cc216727b17
Prevent premature device free in interface_claim_device

interface_set_device_config can trigger a device free (for example
if the device is here only present in a bridge), which renders dev
invalid and leads to segfault. Add a lock to prevent this and
clean-up the code for readability.

Signed-off-by: Gino Peeters <[email protected]>
Signed-off-by: Hans Dedecker <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
interface.c